WITH FD_DICTIONARY_1 AS
  (SELECT ROW_NUMBER() OVER(ORDER BY T.ORDER_NUM ASC) RN, T.*
  FROM FD_DICTIONARY T
  WHERE 1 =1
<#if (CODE!) != ''>
  AND (INSTR(T.CODE, :CODE)  > 0
  OR INSTR(T.NAME, :CODE)    > 0)
</#if>
<#if (VALUE!) != ''>
  AND INSTR(T.VALUE, :VALUE ) > 0
</#if>
<#if (TYPE_ID!) != ''>
  AND T.TYPE_ID = :TYPE_ID
</#if>
  )
SELECT T.*, JDT.CODE AS TYPE_CO, JDT.NAME AS TYPE_NA
FROM FD_DICTIONARY_1 T
LEFT JOIN FD_DICTIONARY_TY JDT ON (JDT.ID = T.TYPE_ID)
WHERE T.RN BETWEEN :BEGIN__ROW__NUM AND :END__ROW__NUM